package app.im;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

import com.lidroid.xutils.util.LogUtils;

import java.util.ArrayList;

import mainUI.AppActivity;
import menhoo.com.i8officelibrary.R;

/**
 * Created by yanglei on 17/1/8.
 */

public class IMEditGrouName extends AppActivity {

    EditText editTextGroupName;
    Button textBtn;

    String GroupName;
    ArrayList<String> EmplIdList = null;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        try {
            GroupName =getIntent().getExtras().getString("GroupName");

        } catch (Exception e) {
            LogUtils.e(e.getMessage() + "");
        }
        try {
            EmplIdList =getIntent().getExtras().getStringArrayList("EmplIdList");

        } catch (Exception e) {
            LogUtils.e(e.getMessage() + "");
        }

        super.onCreate(savedInstanceState);
        //
        setContentView(R.layout.im_group_name_edit);
        try{
            editTextGroupName = (EditText)findViewById(R.id.editTextGroupName);
        }
        catch (Exception e){
            LogUtils.e(e.getMessage()+"");
        }

        setCustomRightButton(R.layout.right_text_btn);
        textBtn=(Button)findViewById(R.id.textBtn);
        textBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent it = new Intent();
                it.putExtra("Data",editTextGroupName.getText().toString());

                setResult(Activity.RESULT_OK, it);
                onBackPressed();
            }
        });

        setTitle("群聊名称");
        editTextGroupName.setText(GroupName);
        editTextGroupName.setSelection(GroupName.length());
    }


}
